<?php
namespace app\home\validate;
use think\Validate;
class Cms extends Validate
{
    protected $rule = [
        'nickname'=> 'require|min:6|max:30',
        'username'=>'require|min:2|max:20',
        'password'=>'require|min:6',
    ];
    protected $message  =   [
        'nickname.require' => '账号不能为空',
        'nickname.max'     => '账号最多不能超过30个字符',
        'nickname.min'     => '账号不能低于6个字符',
        'username.require' => '用户名称不能为空',
        'username.max'     => '用户名称最多不能超过25个字符',
        'username.min'     => '用户名称不能少于2个字符',
        'password.require' => '密码不能为空',
        'password.min'     => '密码最多不能少于6个字符',
    ];


    protected $loginRule = [
        'nickname' => 'require|token',
        'password' => 'require'
    ];

    protected $loginMessage = [
        'nickname.require' =>'账号为空',
        'password.require' => '密码为空',
    ];

}